package org.moflon.boardgamegui.view;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.MenuItem;
import org.moflon.boardgamegui.controller.GenericController;

public class PopmenuAction extends SelectionAdapter {

	GenericController controller;
	GUIField field;

	public PopmenuAction(GenericController controller, GUIField field) {
		this.controller = controller;
		this.field = field;
	}

	@Override
	public void widgetSelected(SelectionEvent e) {
		MenuItem selectedMenuItem = (MenuItem) e.getSource();		
		controller.createFigure(selectedMenuItem.getID(), field);
	}
}

